console.log(11111)
const cluster = require('cluster');
const os = require('os');
const http = require('http');
const process = require('process');

if (cluster.isMaster) {   // cluster.isMaster 是个布尔值
	for (let i = 0; i < os.cpus().length; i++) {
		cluster.fork();
	}
	console.log('主进程');
} else {
	console.log('子进程：' + process.pid);
	// http.createServer((request, response) => {
	// 	response.write('aaa');
	// 	response.end();
	// }).listen(8080);
}